package com.tanhua.server.controller;


import com.tanhua.dto.RecommendUserDto;
import com.tanhua.server.service.TanhuaService;
import com.tanhua.vo.PageResult;
import com.tanhua.vo.TodayBest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tanhua")
public class TanhuaController {

    @Autowired
    private TanhuaService tanhuaService;

    /**
     * 今日佳人
     * @return
     */
    @GetMapping("/todayBest")
    public ResponseEntity queryWithMaxScore(){
        TodayBest vo = tanhuaService.queryWithMaxScore();
        return ResponseEntity.ok().body(vo);
    }

    /**
     * 推荐好友列表
     * @param dto
     * @return
     */
    @GetMapping("/recommendation")
    public ResponseEntity recommendation(RecommendUserDto dto){
        PageResult pr = tanhuaService.recommendation(dto);

        return ResponseEntity.ok().body(pr);

    }
}
